﻿using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TimeToGo.Formatters;
using System;

namespace TimeToGo.Tests
{
    /// <summary>
    /// Summary description for BinaryNumberFormatterTests
    /// </summary>
    [TestClass]
    public class BinaryNumberFormatterTests
    {
        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext { get; set; }

        [TestMethod]
        public void Returns0For0()
        {
            DurationFormatterBase formatter = new BinaryDurationFormatter("");
            TimeSpan duration = TimeSpan.FromSeconds(0);
            string text = formatter.GetDuration(duration);
            Assert.AreEqual("0", text);
        }

        [TestMethod]
        public void Returns1For1()
        {
            DurationFormatterBase formatter = new BinaryDurationFormatter("");
            TimeSpan duration = TimeSpan.FromSeconds(1);
            string text = formatter.GetDuration(duration);
            Assert.AreEqual("1", text);
        }

        [TestMethod]
        public void Returns10For2()
        {
            DurationFormatterBase formatter = new BinaryDurationFormatter("");
            TimeSpan duration = TimeSpan.FromSeconds(2);
            string text = formatter.GetDuration(duration);
            Assert.AreEqual("10", text);
        }

        [TestMethod]
        public void Returns11For3()
        {
            DurationFormatterBase formatter = new BinaryDurationFormatter("");
            TimeSpan duration = TimeSpan.FromSeconds(3);
            string text = formatter.GetDuration(duration);
            Assert.AreEqual("11", text);
        }
    }
}
